home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr27 / use_unus.zip / USE.DOC < prev    next >
Text File  |  1991-06-26  |  3KB  |  88 lines

  1.    USE and UNUSE are utility programs for adding and removing
  2. directories from your path, without retyping the entire path.
  3. USE will add a directory to the PATH; UNUSE removes a directory.
  4.  
  5.    These programs are especially usefull in batch files.  PATH 
  6. statements in .BAT files can come back to haunt you if they are
  7. not updated when AUTOEXEC.BAT's PATH command is updated.  In addition,
  8. they can be used to avoid putting rarely used directories on your path. 
  9. This can save unneed disk and network accesses.
  10.  
  11.    This version of USE and UNUSE will work with MS DOS version 5.0.
  12. Also, unlike the PATH command, USE can make your path as big as your 
  13. environment will allow.  The PATH command can only create paths up 
  14. to 127 bytes in length.
  15.  
  16.    If you don't specify a path, USE and UNUSE will print the
  17. current path.  Similarly, if the directory you specify is not in
  18. the path, USE and UNUSE will just print the current path.
  19.  
  20.    By default, USE will put the new directory at the front of the
  21. path.  Starting USE with the switch "/E" or "/B" will put the
  22. directory at the end of the path.  If USE is started with a dir-
  23. ectory already on the path, that directory will be moved to the
  24. front of the path, or the back if the "/E" or "/B" switch is used.
  25.  
  26. Examples:
  27.  
  28. C:\>Rem   Print the current path.
  29.  
  30. C:\>path
  31. PATH=C:\UTILITY;C:\NORTON;C:\BATCH;C:\DOS
  32.  
  33. C:\>Rem   Starting USE without a directory prints the current path.
  34.  
  35. C:\>use
  36. PATH=C:\UTILITY;C:\NORTON;C:\BATCH;C:\DOS
  37.  
  38. C:\>Rem   Add c:\test to the beginning of the path.
  39.  
  40. C:\>use c:\test
  41. PATH=C:\TEST;C:\UTILITY;C:\NORTON;C:\BATCH;C:\DOS
  42.  
  43. C:\>Rem   Remove c:\test from the path.
  44.  
  45. C:\>unuse c:\test
  46. PATH=C:\UTILITY;C:\NORTON;C:\BATCH;C:\DOS
  47.  
  48. C:\>Rem   C:\DOS is already on the path; it is moved to the front.
  49.  
  50. C:\>use c:\dos
  51. PATH=C:\DOS;C:\UTILITY;C:\NORTON;C:\BATCH
  52.  
  53. C:\>Rem   C:\utility is on the path; /B or /E moves to the back.
  54.  
  55. C:\>use c:\utility /b
  56. PATH=C:\DOS;C:\NORTON;C:\BATCH;C:\UTILITY
  57.  
  58. C:\>Rem   C:\ is not on the path; UNUSE just prints the path.
  59.  
  60. C:\>unuse c:\
  61. PATH=C:\DOS;C:\NORTON;C:\BATCH;C:\UTILITY
  62.  
  63.  
  64.  
  65.     A .BAT file can approximate the function of the USE program, 
  66. although without the duplicate path and other error checking.
  67. Here is the .BAT file:
  68.  
  69. PATH=%1;%PATH%
  70.  
  71.     The %1 will be replaced with first parameter on the command line, 
  72. the ";" will be literally inserted, and %PATH% will be replaced with 
  73. the current path.  However, unlike USE, this method is still limited by 
  74. 127 command line limit.
  75.  
  76.  
  77.     USE and UNUSE have been tested with DOS versions 2, 3, 4, and 5;
  78. PC DOS, MS DOS, and Epson MS DOS.  However, USE and UNUSE change
  79. the environment area of DOS, and you should test it throughly on
  80. your machine.
  81.  
  82.     This software may be freely used, but not sold for profit.
  83. The user assumes all risk associated with the use of software.
  84. Please include this documentation when distributing this software.
  85.  
  86. June 26, 1991
  87. James Haley
  88. 71121,3644